fun (unsigned char *p1, int len) { unsigned char* buf = new unsigned char[len+1]; memcpy(buf, p1, len); }